/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_rayos_x")
@NamedQueries({
    @NamedQuery(name = "CexRayosX.findAll", query = "SELECT c FROM CexRayosX c")})
public class CexRayosX implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "crx_id")
    private Integer crxId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "crx_nombre")
    private String crxNombre;
    @Basic(optional = false)
    @NotNull
    @Column(name = "crx_estado")
    private int crxEstado;
    @OneToMany(mappedBy = "cexRayosX", fetch = FetchType.LAZY)
    private List<CexRayosX> cexRayosXList;
    @JoinColumn(name = "crx_crx_id", referencedColumnName = "crx_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private CexRayosX cexRayosX;
    @OneToMany(mappedBy = "cexRayosX", fetch = FetchType.LAZY)
    private List<CexPedidoRayos> cexPedidoRayosList;

    public CexRayosX() {
    }

    public CexRayosX(Integer crxId) {
        this.crxId = crxId;
    }

    public CexRayosX(Integer crxId, String crxNombre, int crxEstado) {
        this.crxId = crxId;
        this.crxNombre = crxNombre;
        this.crxEstado = crxEstado;
    }

    public Integer getCrxId() {
        return crxId;
    }

    public void setCrxId(Integer crxId) {
        this.crxId = crxId;
    }

    public String getCrxNombre() {
        return crxNombre;
    }

    public void setCrxNombre(String crxNombre) {
        this.crxNombre = crxNombre;
    }

    public int getCrxEstado() {
        return crxEstado;
    }

    public void setCrxEstado(int crxEstado) {
        this.crxEstado = crxEstado;
    }

    public List<CexRayosX> getCexRayosXList() {
        return cexRayosXList;
    }

    public void setCexRayosXList(List<CexRayosX> cexRayosXList) {
        this.cexRayosXList = cexRayosXList;
    }

    public CexRayosX getCexRayosX() {
        return cexRayosX;
    }

    public void setCexRayosX(CexRayosX cexRayosX) {
        this.cexRayosX = cexRayosX;
    }

    public List<CexPedidoRayos> getCexPedidoRayosList() {
        return cexPedidoRayosList;
    }

    public void setCexPedidoRayosList(List<CexPedidoRayos> cexPedidoRayosList) {
        this.cexPedidoRayosList = cexPedidoRayosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (crxId != null ? crxId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexRayosX)) {
            return false;
        }
        CexRayosX other = (CexRayosX) object;
        if ((this.crxId == null && other.crxId != null) || (this.crxId != null && !this.crxId.equals(other.crxId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.CexRayosX[ crxId=" + crxId + " ]";
    }
    
}
